home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 25 / CU Amiga Magazine's Super CD-ROM 25 (1998)(EMAP Images)(GB)(Track 1 of 2)[!][issue 1998-08].iso / CUCD / Programming / GMS / GMSDev / Includes / files / segments.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-03-15  |  2.1 KB  |  81 lines

  1. #ifndef FILES_SEGMENTS_H
  2. #define FILES_SEGMENTS_H TRUE
  3.  
  4. /*
  5. **   $VER: segments.h V1.0
  6. **
  7. **   Segment Definitions.
  8. **
  9. **   (C) Copyright 1996-1998 DreamWorld Productions.
  10. **       All Rights Reserved.
  11. */
  12.  
  13. #ifndef DPKERNEL_H
  14. #include <dpkernel/dpkernel.h>
  15. #endif
  16.  
  17. /****************************************************************************
  18. ** Segment object.
  19. */
  20.  
  21. #define VER_SEGMENT  1
  22. #define TAGS_SEGMENT (ID_SPCTAGS<<16)|ID_SEGMENT
  23.  
  24. struct Segment {
  25.   struct Head Head;        /* [00] Standard structure header */
  26.   struct Segment *Prev;    /* [12] Previous segment */
  27.   struct Segment *Next;    /* [16] Next segment */
  28.   LONG   MemType;          /* [20] Memory type (eg MEM_DATA) */
  29.   APTR   Address;          /* [24] Pointer to segment start */
  30.   struct FileName *Source; /* [28] Source of segment */
  31.   WORD   CPU;              /* [32] The CPU type if it is a MEM_CODE segment */
  32.  
  33.   /* Private fields below */
  34.  
  35.   APTR   prvDOSSeg;
  36. };
  37.  
  38. #define SGA_Prev     (12|TAPTR)
  39. #define SGA_Next     (16|TAPTR)
  40. #define SGA_MemType  (20|TLONG)
  41. #define SGA_Address  (24|TAPTR)
  42. #define SGA_Source   (28|TAPTR)
  43. #define SGA_CPU      (32|TWORD)
  44.  
  45. /****************************************************************************
  46. ** This structure is identical to the standard segment struct but defines
  47. ** the Address as a function (ANSI-C prevents function<->data type
  48. ** conversion).
  49. */
  50.  
  51. struct CodeSegment {
  52.   struct Head Head;
  53.   struct Segment *Prev;
  54.   struct Segment *Next;
  55.   LONG   MemType;
  56.  
  57.   #ifdef _DCC
  58.     void (*Address)(__D0 LONG ID, __D1 LONG Version, __D2 LONG Revision,
  59.            __A1 struct DPKBase *, __A0 BYTE *Arguments);
  60.   #else
  61.    #ifdef __SASC
  62.     __asm void (*Address)(register __d0 LONG ID,
  63.                  register __d1 LONG Version,
  64.                  register __d2 LONG Revision,
  65.                  register __a1 struct DPKBase *DPKBase,
  66.                  register __a0 BYTE *Arguments);
  67.    #else
  68.     void (*Address)(LONG ID, LONG Version, LONG Revision, struct DPKBase *,
  69.            BYTE *Arguments);
  70.    #endif
  71.   #endif
  72.  
  73.   struct FileName *Source;
  74.  
  75.   /*** Private fields below ***/
  76.  
  77.   APTR   prvDOSSeg;
  78. };
  79.  
  80. #endif /* FILES_SEGMENTS_H */
  81.